//
//  WFMessageVC.m
//  谷居
//
//  Created by dllo on 16/7/6.
//  Copyright © 2016年 刘万方. All rights reserved.
//

#import "WFMessageVC.h"
#import "WFTableView.h"
@interface WFMessageVC ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, retain) WFTableView *tableView;

@property (nonatomic, retain) NSMutableArray *textArray;

@property (nonatomic, retain) NSMutableArray *imageArray;
@end

@implementation WFMessageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"消息中心";

    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"返回2.png"] style:1 target:self action:@selector(pop)];
    [self createData];

    [self createTableView];
}

- (void)createData {
    self.imageArray = [NSMutableArray array];
    self.textArray = [NSMutableArray array];
    self.textArray = @[@"平论", @"被喜欢", @"系统消息"].mutableCopy;
    UIImage *image = [UIImage imageNamed:@"Unknown-25.png"];
    UIImage *image2 = [UIImage imageNamed:@"Unknown-26.png"];
    UIImage *image3 = [UIImage imageNamed:@"Unknown-27.png"];
    [self.imageArray addObject:image];
    [self.imageArray addObject:image2];
    [self.imageArray addObject:image3];
    NSLog(@"%@", self.imageArray);
}
-(void)createTableView {
    _tableView = [[WFTableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain];
    [self.view addSubview:_tableView];
    [_tableView release];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.rowHeight = 70;
    _tableView.separatorStyle = 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *reuse = @"reuse";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuse];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuse];
    }
    cell.imageView.image = self.imageArray[indexPath.row];
    cell.textLabel.text = self.textArray[indexPath.row];
    return  cell;
}
- (void)pop {
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated {
    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated {
    
    self.tabBarController.tabBar.hidden = NO;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
